using System;
using System.Data;
using System.Collections.Generic;
using AIM.Common;
using AIM.Model;
using BrightFrame.Aop;
namespace AIM.BLL
{
    [Connection]
	public class CustodyPeriodBLL : ContextBoundObject
	{
        private readonly AIM.DAL.CustodyPeriodDAL _custodyPeriodDAL = new AIM.DAL.CustodyPeriodDAL();
        private readonly AIM.DAL.SystemDAL _systemDAL = new DAL.SystemDAL();

        public List<CustodyPeriod> QueryAll()
        {
            return _custodyPeriodDAL.QueryAll();
        }

        public CustodyPeriod GetModel(int custodyPeriodID)
        {
            return _custodyPeriodDAL.GetModel(custodyPeriodID);
        }

        public int Add(CustodyPeriod custodyPeriod)
        {
            _custodyPeriodDAL.Add(custodyPeriod);
            return _systemDAL.GetLastInsertID();
        }

        public void Update(CustodyPeriod custodyPeriod)
        {
            _custodyPeriodDAL.Update(custodyPeriod);
        }

        public void Delete(int custodyPeriodID)
        {
            _custodyPeriodDAL.Delete(custodyPeriodID);
        }

        public int CountByCustodyPeriodID(int custodyPeriodID)
        {
            return _custodyPeriodDAL.CountByCustodyPeriodID(custodyPeriodID);
        }

        public CustodyPeriod GetByCustodyPeriodName(string custodyPeriodName)
        {
            return _custodyPeriodDAL.GetByCustodyPeriodName(custodyPeriodName);
        }
	}
}

